﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace ProjectNocturnalFool
{
    class PanelControl : UserControl
    {
        public Color bgTint = Color.White;
        public Color borderColor = Color.Gray;

        public override void LoadContent()
        {
            base.LoadContent();
            _bgTexture = TacticsGame.Instance.Content.Load<Texture2D>(Constants.TextureWhite);

            depth = ControlDepth.NonDrag;
        }

        public override void Draw(GameTime gameTime)
        {
            TacticsGame.Instance.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone);
            Rectangle targetRect = new Rectangle(x, y, width, height);

            TacticsGame.Instance.spriteBatch.Draw(_bgTexture,
                                                  targetRect,
                                                  null,
                                                  bgTint,
                                                  0,
                                                  Vector2.Zero,
                                                  SpriteEffects.None,
                                                  0);

            Util.drawBorder(targetRect, borderColor, 1);

            TacticsGame.Instance.spriteBatch.End();

            base.Draw(gameTime);
        }

    }
}
